package com.wzx.mvc.controller;

import com.wzx.mvc.annocation.*;

import java.util.HashMap;
import java.util.Map;

//@Security({"666"})
@Controller
@RequestMapping("/user")
public class UserController {
    static Map<String, Integer> money = new HashMap<>();
    static {
        money.put("zhangsan", 1000);
        money.put("lisi", 800);
    }

    @Security({"zhangsan", "lisi"})
    @RequestMapping()
    public String get(String username) {
        if (!money.containsKey(username)) {
            return "不存在: " + username;
        }
        return username + " 你的余额为：" + money.get(username);
    }

    @RequestMapping("/hello")
    public String hello(String username) {
       return "hello " + username;
    }
}
